package cn.mldn.microcloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.mldn.microcloud.service.IMessageService;

@RestController
public class MessageController {

	
	@Autowired
	private IMessageService iMessageService;
	
	@PostMapping("/sendByQueue")
	public boolean sendByQueue(String queue,String message) {		
		return iMessageService.sendMessage(queue, message); 
	}
	
	@PostMapping("/sendByExchange")
	public boolean sendByExchange(String exchange,String key , String message) {		
		return iMessageService.sendMessage(exchange,key, message); 
	}
	
}
